package com.guaoran.other.factory.simple;

import com.guaoran.other.factory.Mengniu;
import com.guaoran.other.factory.Milk;
import com.guaoran.other.factory.Telunsu;
import com.guaoran.other.factory.Yili;

/**
 * @author : 孤傲然
 * @Description :
 * @date :2018/5/12 22:10
 */
public class SimpleFactory  {
    public Milk getMilk(String name){
        if("伊利".equals(name)){
            return new Yili();
        }else if("蒙牛".equals(name)){
            return new Mengniu();
        }else if("特仑苏".equals(name)){
            return new Telunsu();
        }
        return null;
    }
}
